package org.cy.peoplehill.client;

import com.google.gwt.user.client.rpc.IsSerializable;

public class User implements IsSerializable {
	private String name;
	
	/**
	 * Only used by serialization
	 */
	public User(){}
	
	/**
	 * Constructs a {@link User} instance.
	 * 
	 * @param name user's name
	 */
	public User(String name) {
		this.name = name;
	}
	  
	/**
	 * Returns the user's name.
	 * 
	 * @return user's name
	 */	
	public String getName(){
		return this.name;
	}

	public boolean equals(Object obj){
		if(obj == this)return true;
		if(obj instanceof User){
			User user = (User)obj;
			return name.equals(user.getName());
		}
		return false;
	}
}
